Repository navigation
Reject overflowing output token estimates before admission - #980
Gajesh2007 wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50a767cb54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Consolidated into #1056 for review and merge after #1094, #1095 and #1096. #1056 contains this branch's exact head ( |
A large positive
nmultiplied by the requested output limit can overflow the generic inference estimate and bypass quota admission. A full or unlimited bucket also admits a saturated maximum-integer estimate, which can then wrap downstream cost and capacity calculations. Reject the invalid product with 400invalid_request_errorandparam: "n"before quota, balance reservation or routing.The shared estimator selects the existing explicit/default bound once and reports whether multiplication fits. Both inference callers use the same validation response. Fitting products retain their existing estimate, forwarded generation limits and one-burst quota policy. This PR handles multiplication overflow; #943 separately hardens prompt-plus-output sums. Existing numeric conversions and independently huge representable limits are outside this change.
flowchart LR subgraph Before A[Generic completions or messages] --> B[estimateRequestedMaxTokens] B --> C[Unchecked n times token bound] C --> D[Wrapped estimate reaches quota and billing] end subgraph After E[Inference request] --> F[estimateRequestedMaxTokens reports value and validity] F --> G[validateRequestedMaxTokens] G -->|overflow| H[400 invalid_request_error, param n] G -->|fits| I[Existing quota, reservation and routing] endValidation:
git diff --checkand 278-page docs lint pass. API, consumer and routing docs describe the rejection boundary.